{
  "properties" : { },
  "id" : "copy1735024633051d35334",
  "script" : null,
  "groupId" : "1d212495794d4254ab8b5e9f1e9dfc68",
  "name" : "http调用自身接口",
  "createTime" : null,
  "updateTime" : 1735030254756,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/http002",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"timestamp\": \"2024-12-24T08:49:10.290+00:00\",\n    \"status\": 404,\n    \"error\": \"Not Found\",\n    \"message\": \"\",\n    \"path\": \"/conf-portal/http002\"\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "timestamp",
      "value" : "2024-12-24T08:49:10.290+00:00",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "status",
      "value" : "404",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "error",
      "value" : "Not Found",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "path",
      "value" : "/conf-portal/http002",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
import http;
import request;
import response;
import log;
import magic;

var header = request.getHeaders("Host");
var clientIp = request.getClientIP(); 
var headxxx = request.getHeaders('xxx');
// 相关文档： https://www.ssssssss.org/magic-api/pages/module/http/
var tt = http.connect('http://127.0.0.1:29410/hello/1').contentType('application/json');
log.info('Hello {}','MagicAPI');


var message =  magic.call('get','http://127.0.0.1:29410/hello/1',{
    message : 'Hello,Magic API!' //传入参数 
})



log.info('message--> {}',message);
// 构建Json结果，结果不会经过框架包装处理。
return response.json({
    ok: clientIp
})
//直接返回该text，不会被包装处理
// return response.text(tt);
